package com.luodan.controller;

import com.luodan.domain.User;
import com.luodan.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class LoginRegedit {
    @Autowired
    private UserService userService;
    @RequestMapping("/regedit")
    public ModelAndView regedit(User user){
        ModelAndView modelAndView=new ModelAndView();
        System.out.println("来到了控制层————————————————");
        System.out.println(user);
        userService.saveUser(user);
        modelAndView.setViewName("index.jsp");
        return modelAndView;
    }
}
